package com.chainyoung.component_tmperson.ui.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chainyoung.component_tmperson.R;
import com.chainyoung.component_tmperson.entity.Reward;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

public class RewardAdapter extends BaseQuickAdapter<Reward, BaseViewHolder> {

    private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");


    public RewardAdapter(@Nullable List<Reward> data) {
        super(R.layout.layout_reward_item, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, Reward item) {
        helper.setText(R.id.tv_type,item.getType());
        helper.setText(R.id.tv_time, sdf.format(new Date(item.getAddtime() * 1000)));
        helper.setText(R.id.tv_num,item.getNum());
        helper.setText(R.id.tv_reward,item.getFee());
    }


}
